package demo1;

import java.util.Date;
public class GoodsTest {
    public static <date> void main(String[] args) {
        Goods.country = "中国";
        Goods[] arr = new Goods[3];
        Goods g1 = new Goods("01","手机",1000);
        Goods g2 = new Goods("02","手表",500);
        Goods g3 = new Goods("03","手电",100);
        arr[0] = g1;
        arr[1] = g2;
        arr[2] = g3;

        double sum = 0;

        for (int i = 0; i < arr.length; i++) {
            Goods g = arr[i];
           // System.out.println(g);
            sum += g.getPrice();
            System.out.println(arr[i].country);
        }
        double avg = sum / arr.length;
        System.out.println(avg);







    }
}
